<template>
  <div class="AdoptItem">
    <img :src="require(`../assets/adoptimage/${article.id}-1.jpg`)" />
    <div>
      <div>
        <span class="introduce">{{ article.title }}</span>
        <span class="sex0" v-if="article.sex == 0">♀</span>
        <span class="sex1" v-if="article.sex == 1">♂</span>
      </div>
      <span class="age">{{ article.age }}</span>
      <div class="detail">
        <span class="nickname">{{ article.name }}</span>
        <span class="address">{{ article.address }}</span>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  // article属性接收父组件传来的参数
  props: ["article"],
  data() {
    return {
      // navactive: "1",
    };
  },
};
</script>
<style scoped lang="scss">
.AdoptItem {
  width: 45vw;
  background-color: #fff;
  margin: 0 0 15px 3vw;
  border-radius: 10px 10px 0 0;
  border: 1px solid #ddd;
  img {
    width: 100%;
    height: 40vw;
    border-radius: 10px 10px 0 0;
  }
  > div {
    padding: 8px 10px;
    .introduce {
      display: inline-block;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      // font-weight: bold;
      margin-right: 10px;
      width: 30vw;
    }
    .sex0 {
      font-weight: 900;
      color: #e678ab;
    }
    .sex1 {
      font-weight: 900;
      color: #3da7c0;
    }
    .age {
      display: inline-block;
      margin: 8px 0px;
      padding: 1px 8px;
      font-size: 12px;
      background-color: #d4f8ff;
      color: #3da7c0;
    }
    .detail {
      color: #bcbcba;
      font-size: 12px;
      display: flex;
      justify-content: space-between;
    }
  }
}
</style>